<template>
	<view class="container">
		<uni-forms label-position="top" label-width="100px">
			<!-- 设备名称 -->
			<uni-forms-item label="设备名称:" required>
				<uni-easyinput v-model="test" placeholder="请输入设备名称" />
			</uni-forms-item>
			<!-- 设备必填项 -->
			<uni-forms-item label="必填项目:" required>
				<uni-data-checkbox v-model="baseFormData.inputItems" multiple :localdata="inputItems" />
			</uni-forms-item>
		</uni-forms>
<!-- 		<view class="device-name">
			<uni-forms-item label="设备名称:" required>
				<uni-easyinput v-model="test" placeholder="请输入设备名称" />
			</uni-forms-item>
		</view>
		<view class="device-setup">
			<uni-forms-item label="配置设备" required>
				<uni-data-checkbox v-model="baseFormData.inputItems" multiple :localdata="inputItems" />
			</uni-forms-item>
		</view> -->
		<button @click="addDevice()" class="button-add">添加设备</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				checkbox1: true,
				checkbox2: false,
				test: '',
				baseFormData: {
					name: '',
					age: '',
					introduction: '',
					sex: 2,
					inputItems: ['name', 1],
					datetimesingle: 1627529992399
				},
				// 多选数据源
				inputItems: [{
					text: '姓名',
					value: 'name',
					// disable:true
				}, {
					text: '身份证号',
					value: 1,
				}, {
					text: '设备型号',
					value: 2
				}, {
					text: '设备标识码',
					value: 3
				}, {
					text: '设备厂商',
					value: 4
				}, {
					text: '设备生产日期',
					value: 5
				}, {
					text: '设备保修期',
					value: 6
				}, {
					text: '其他配置1',
					value: 7
				}, {
					text: '其他配置2',
					value: 8
				}, {
					text: '其他配置3',
					value: 9
				}, ],
			}
		},
		methods: {
			addDevice() {
				console.log("点了添加设备")
			}
		}
	}
</script>

<style scoped>
	@import url('@/common/uni.css');
	.button-add {
		width: 120px;
		margin-top: 30px;
	}
	
	.container {
		padding: 20px;
	}
	
	page {
		background-color: #fff;
	}
</style>